#Load the library and Create Reference to Library object 
require 'watir'
include Watir

# define varaibles
testURL = 'http://www.google.com.ua/'

# Create a new IE object
puts 'tests execution started'
3.times do
  ie = Watir::IE.new
  
  # Go to the web site
  ie.goto testURL
  if ie.contains_text('Google.com')
    puts 'Test Passed: Page 1 Validated'
  else
    puts 'Test Failed: Page 1 not Validated'
  end
  ie.text_field(:name, "q").set "pickaxe"
  ie.button(:name, "btnG").click
  if ie.text.include? "Programming Ruby"
    puts "  Test Passed. Found the test string: 'Programming Ruby'. Actual Results match Expected Results."
  else
    puts "  Test Failed! Could not find: 'Programming Ruby'."
  end
  ie.close
end
puts 'tests execution finished'